﻿@model IEnumerable<BudgetMealsModels.Entities.Recipe>

@{
    ViewBag.Title = "Search Results";
}

<div id="searchPage">
<h2>Search Results</h2>

@{
    Html.RenderPartial("SearchBar");
    if(Model.Any()){
        foreach (var result in Model)
        {
            <div style="height:175px;">
                <div style="float: left; position: relative; padding-right: 25px;">
                    <img src="@Url.Action("GetImage", "Recipe", new { result.RecipeID, image = 0 })" alt="recipeImage" width="150" height="150"/>
                    <div style="position: absolute; left:0px; bottom: 0px; text-align: center; width: 150px; background-color: White; opacity: .75;">
                        @{Html.RenderPartial("../Recipe/Rating", result.Rating);}
                    </div>
                </div>
                <h4>@Html.ActionLink(@result.Name, "../Recipe/ShowRecipe", new { Id = result.RecipeID })</h4>
                <div style="margin-left:25px;">
                    @result.Ingredients.Count() ingredients totaling at $@result.Cost.ToString("N2") <br />
                    @Html.Raw(result.Summary)
                </div>
            </div>
        }
    }
    else
    {
        <p>No results found.</p>
    }
}
</div>